from selenium import webdriver
from selenium.webdriver.common.by import By
import time

options = webdriver.EdgeOptions()  # 创建配置项对象
options.add_argument("--disable-blink-features=AutomationControlled")  # 添加配置项:跳过部分反爬虫程序
browser = webdriver.Edge(options=options)  # 将配置项添加到浏览器控制对象中
browser.get('https://www.csdn.net/')  # 跳转页面
# 锁定标签
div_text = browser.find_elements(By.XPATH,
                                 '//*[@id="floor-www-index_558"]/div/div[3]/div[1]/div[2]/div[1]/div[2]/div/div/a[1]')
# 获取数据
for i in div_text:
    print(i.text)
# 关闭浏览器
browser.quit()
time.sleep(5)

print("helloworld")
